{% extends "base.html" %}
{% block title %} my shopping cart{% endblock%}
{% block pagename %} My shopping cart {% endblock %}

{% block content%}
<div class="row">
	<div class="span10">
		<table class="table-condensed">
			<thead>
				<tr>
					<th class="header">quantity</th>
					<th class="yellow header">book title</th>
					<th class="blue header">unit price</th>
					<th class="green header">subtotal</th>
				</tr>
			</thead>
			<tbody>
				{% for item in cart.items %}
				<tr>
					<th>{{item.quantity}}</th>
					<td>{{item.book.title}}</td>
					<td>{{item.book.price}}</td>
					<td>{% widthratio item.quantity 1 item.book.price %}</td>
				</tr>
				{% endfor %}
				<tr>
					<th></th>
					<td></td>
					<th>total:</th>
					<th>{{cart.total_price}}</th>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="span4">
		<p>
			<a class="btn btn-primary span2" href="/bookstore">continue shopping</a>
		</p>
		<p>
			<a class="btn btn-danger span2" href="{% url bookstoreapp.views.clean_cart %}">clean cart</a>
		</p>
		<p>
			<a class="btn btn-success span2" href="{% url bookstoreapp.views.create_order %}">check out</a>
		</p>

	</div>
</div>
{% endblock %}
